package au.edu.unsw.bookmarket.jdo;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import java.util.Date;

@PersistenceCapable
public class Ads {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    @Persistent
    private Key seller;
    @Persistent
    private Key item;
    @Persistent
    private Key course;
    @Persistent
    private String contact;
    @Persistent
    private double price;
    @Persistent
    private String misc;
    @Persistent
    private Date expiry;

    // constructor
    public Ads(Key seller, String contact, double price, String misc,
            Key item, Key course, Date expiry) {
        super();
        this.seller = seller;
        this.contact = contact;
        this.price = price;
        this.misc = misc;
        this.item = item;
        this.course = course;
        this.expiry = expiry;
    }

    public Ads() {
    }

    // accessors
    public Key getKey() {
        return key;
    }

    public void setKey(Key key) {
        this.key = key;
    }

    public Key getSeller() {
        return seller;
    }

    public void setSeller(Key seller) {
        this.seller = seller;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getMisc() {
        return misc;
    }

    public void setMisc(String misc) {
        this.misc = misc;
    }

    public Key getItem() {
        return item;
    }

    public void setItem(Key item) {
        this.item = item;
    }

    public Key getCourse() {
        return course;
    }

    public void setCourse(Key course) {
        this.course = course;
    }

    public Date getExpiry() {
        return expiry;
    }

    public void setExpiry(Date expiry) {
        this.expiry = expiry;
    }
}
